from fastapi import FastAPI
from handler import HelloHandler

app = FastAPI() # 导包时就会创建 FastAPI 实例

# 创建处理器实例
hello_handler = HelloHandler("World")

# 定义路由
@app.get("/hello")
def hello():
    return hello_handler.say_hello()

@app.get("/query")
def query():
    return hello_handler.query_mysql()